package ta.structure;

import java.util.Objects;

public class TALocation extends TAElem
{
    private String id;
    private String name;
    private TATemplate parent;

    public String getId()
    {
        return id;
    }

    public TALocation setId(String id)
    {
        this.id = id;
        return this;
    }

    public String getName()
    {
        return name;
    }

    public String getIdName()
    {
        return String.format("%s_%s", name, id);
    }

    public TALocation setName(String name)
    {
        this.name = name;
        return this;
    }

    public TATemplate getParent()
    {
        return parent;
    }

    public TALocation setParent(TATemplate parent)
    {
        this.parent = parent;
        return this;
    }

    @Override
    public boolean equals(Object o)
    {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TALocation that = (TALocation) o;
        return id.equals(that.id);
    }

    @Override
    public int hashCode()
    {
        return Objects.hash(id);
    }
}
